<?php
$cruise = $this->cruise;
$cruiseCabin = $this->cruiseCabin;
?>
<div class="wrapper-content">
    <div class="top-title">
        <div class="content-title">
            <h2><?php $categoryTitle = $cruise['cruise_category_title'] ? $cruise['cruise_category_title'] : str_replace('-', ' ' ,trim($this->categoryTitle)); echo $categoryTitle ?></h2>
        </div>
    </div>

    <div class="span4" id="content-left-2">
        <div class="clear"></div>
        <!-- column left -->
        <?php $columnLeft = $this->columnLeft; ?>
        <?php if($columnLeft): ?>
            <?php foreach($columnLeft as $key => $value): ?>
                <div class="block-left-2" style="margin-left:10px">
        		    <?php if($value['list_cruise']): ?>
                	<div class="block-left-2-title">
                		<h4><?php echo $value['cruise_type_title']; ?></h4>
                	</div>
                	<div class="block-left-2-content" style="margin-left:10px;">
                		<ul>
                		    <!-- cruise -->
                		    <?php foreach($value['list_cruise'] as $k => $v):?>
                		    <?php $url = "/". str_replace(' ', '-' ,trim($categoryTitle)) . '/'. str_replace(' ', '-' ,trim($v['name'])). '-' .$v['link_id'] .'.html'; ?>
                			<li class="menu-left">
                				<?php if(isset($v['list_child_cruise']) &&  $v['list_child_cruise']): ?>
	                				<span><?php echo $v['name'];?></span>
                					<ul style="margin-left:10px;">
	                					<?php foreach($v['list_child_cruise'] as $childCruise): ?>
	                						<?php $urlChild = "/". str_replace(' ', '-' ,trim($categoryTitle)). '/'. str_replace(' ', '-' ,trim($childCruise['name'])). '-' .$childCruise['link_id'] .'.html'; ?>
	                						<li><a href="<?= $urlChild ?>" <?php echo ($childCruise['id'] == $this->cruiseId) ? 'class="menu-left-active"' : '' ?>><?php echo $childCruise['name']; ?></a></li>
	                					<?php endforeach; ?>
                					</ul>
                				<?php else: ?>
	                				<a href="<?php echo $url; ?>" <?php echo ($v['id'] == $this->cruiseId) ? 'class="menu-left-active"' : '' ?>><?php echo $v['name'];?></a>
                				<?php endif; ?>
                			</li>
                			<?php endforeach; ?>
                		</ul>
                	</div>
        			<?php endif; ?>
                </div>
        	<?php endforeach; ?>
        <?php endif; ?>
        <!-- end column left -->
        <div class="clear" style="width: 100%; height: 20px;"></div>
    </div>

    <div class="span12" id="content-right-2">
    	<?php if($cruise): ?>
    	<?php $url = "/". str_replace(' ', '-' ,trim($categoryTitle)). '/'. str_replace(' ', '-' ,trim($cruise['name'])). '-' .$cruise['id'] .'.html'; ?>
    	<div class="content-right-2-content">
            <div class="top-detail">
                <img class="thumbnail-detail" src="<?php echo $cruise['detail_thumbnail'] ? $cruise['detail_thumbnail'] : $cruise['thumbnail']; ?>" />
                <div class="top-right-detail">
                    <h4 style="line-height:20px;"><?php echo $cruise['title']; ?></h4>
                    <div class="detail-overview">
                        <p style="font-size: 13px;"><?php echo $this->snippet($cruise['overview'], 300); ?></p>
                    </div>
	                <div class="block-btn-enquire">
	           		    <a href="/enquire/index/t/3/id/<?php echo $cruise['id']; ?>" class="btn btn-enquire" ><?php echo $this->translate('Enquire_Now') ?></a>
	           		    <a href="/send-to-friend/index/t/3/id/<?php echo $cruise['id']; ?>" class="btn btn-send-mail"><?php echo $this->translate('Share_This_Offer') ?></a>
	           		</div>
                </div>
            </div>
            <div class="block-open-social-like">
                <div class="add-this-botton">
	                <!-- AddThis Button BEGIN -->
					<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;pubid=ra-500bc4165d38d108"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>
					<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
					<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-500bc4165d38d108"></script>
					<!-- AddThis Button END -->
				</div>
                <div class="plusone google-plus">
                   <g:plusone size="medium"></g:plusone>
                </div>
                <div class="facebook-like">
                   <div class="fb-like" data-href="<?php echo $this->serverUrl().$url; ?>" data-send="true" data-width="450" data-show-faces="false"></div>
                </div>
            </div>
            <div class="block-content">
                    <div class="detail"><?php echo $cruise['detail'] ?></div>
                    <div class="price-table" id="price">
                        <!-- price table -->
                        <table class="table tbl">
                            <thead>
                                <tr>
                                    <th rowspan="2" style="text-align:center"><?php echo $this->translate('Cabin_type') ?></th>
                                    <th colspan="5" style="text-align:center"><?php echo $this->translate('Price/Per_Pax(USD)'); ?>
                                    	<br/><?php echo $this->translate('Base_on_TWN/DBL_sharing'); ?>
                                    </th>
                                    <th rowspan="2" style="text-align:center"><?php echo $this->translate('SGL_Supp'); ?></th>
                                </tr>
                                <tr>
                                    <?php if($cruiseCabin): ?>
                                        <?php foreach($cruiseCabin[0]['price'] as $k => $v): ?>
                                            <th><?php echo $v['number_customer'] ?></th>
                                        <?php endforeach; ?>
                                    <?php else:  ?>
                                        <th style="text-align:center"> 2-3 </th>
                                        <th style="text-align:center"> 4-7 </th>
                                        <th style="text-align:center"> 8-11 </th>
                                        <th style="text-align:center"> 12-14 </th>
                                        <th style="text-align:center"> 15+1 </th>
                                    <?php endif; ?>
                                </tr>
                            </thead>
                            <tbody>
                                <?php if($cruiseCabin): ?>
                                    <?php foreach($cruiseCabin as $key => $value): ?>
                                        <tr>
                                            <td  style="text-align:left"><?php echo $value['cabin_type'] ?></td>
                                            <?php foreach($value['price'] as $k => $v): ?>
                                                <td><?php echo $v['price'] ?></td>
                                            <?php endforeach; ?>
                                            <td><?php echo $value['sgl_supp'] ?></td>
                                        </tr>
                                    <?php endforeach; ?>
                                <?php else: ?>
                                    <tr>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                        <!-- end price table -->
                    </div>
                    
                    <?php if($this->otherLink): ?>
                    <!-- OTHER LINKS -->
                    <div class="other-link">
                    	<!-- <h4><?php //echo $this->translate('Other_Tours') ?></h4>  -->
                    	<ul>
                    		<?php foreach($this->otherLink as $k => $v): ?>
                    			<?php $url = "/". str_replace(' ', '-' ,trim($categoryTitle)) . '/'. str_replace(' ', '-' ,trim($v['name'])). '-' .$v['id'] .'.html'; ?>
                    			<li><a href="<?= $url ?>"><?php echo $v['title']; ?></a></li>
                    		<?php endforeach; ?>
                    	</ul>
                    </div><!--//END OTHER LINK  -->
                    <?php endif; ?>
            </div>
    	</div>
    	<?php else: ?>
    		<h4 style="margin:10px 0px 0px 20px"><?php echo $this->translate('Updating_data!') ?></h4>
    	<?php endif; ?>
    </div>
</div>


<div id="fb-root"></div>
<script>
</script>

<script>
$(document).ready(function() {
    $('.tab').click(function() {
    	$('.active').removeClass('active');
    	$(this).addClass("active");
    	$("#"+ $(this).attr('data-tab')).addClass("active");
    });
});
</script>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>